import 'package:flutter_baseui/generated/json/base/json_convert_content.dart';
import 'package:flutter_baseui/views/home_screen/model/home_list_entity.dart';

HomeListEntity $HomeListEntityFromJson(Map<String, dynamic> json) {
  final HomeListEntity homeListEntity = HomeListEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    homeListEntity.id = id;
  }
  final String? title = jsonConvert.convert<String>(json['title']);
  if (title != null) {
    homeListEntity.title = title;
  }
  final String? subTitle = jsonConvert.convert<String>(json['subTitle']);
  if (subTitle != null) {
    homeListEntity.subTitle = subTitle;
  }
  final String? imageName = jsonConvert.convert<String>(json['imageName']);
  if (imageName != null) {
    homeListEntity.imageName = imageName;
  }
  final String? navigation = jsonConvert.convert<String>(json['navigation']);
  if (navigation != null) {
    homeListEntity.navigation = navigation;
  }
  return homeListEntity;
}

Map<String, dynamic> $HomeListEntityToJson(HomeListEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['title'] = entity.title;
  data['subTitle'] = entity.subTitle;
  data['imageName'] = entity.imageName;
  data['navigation'] = entity.navigation;
  return data;
}

extension HomeListEntityExtension on HomeListEntity {
  HomeListEntity copyWith({
    int? id,
    String? title,
    String? subTitle,
    String? imageName,
    String? navigation,
  }) {
    return HomeListEntity()
      ..id = id ?? this.id
      ..title = title ?? this.title
      ..subTitle = subTitle ?? this.subTitle
      ..imageName = imageName ?? this.imageName
      ..navigation = navigation ?? this.navigation;
  }
}